<?php
include 'includes.php';

?>


<!-- Bootstrap core CSS -->


<html lang="en">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta name="description" content="">
        <meta name="author" content="">
        <link rel="shortcut icon" href="../../assets/ico/favicon.ico">
        <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet">
        <link href="bootstrap/css/bootstrap.css" rel="stylesheet">
        <link href="bootstrap/css/css.css" rel="stylesheet">
        <script type="text/javascript" src="bootstrap/js/jquery-1.11.0.min.js"></script>

        <title>The Pengüins mafia Bis List - Editar PJ</title>

    </head>


<?php
include './cabecera.php';


?>



<!-- Main jumbotron for a primary marketing message or call to action -->


<div class="container contenido">

    <div class="page-header">
        <h2>Raids <small>Gestion de Raids</small></h2>
    </div>
</div>

<?php
if (isset($_SESSION['user']) && $_SESSION['user']['permisos'] == 'admin') {
?>

<div class="container">
    <!-- Example row of columns -->
    <div class="row">
        <div class="col-md-1">
            <button type="button" class="btn btn-success btn-md" onclick="window.location.href = 'addraid.php'">
                <span class="glyphicon glyphicon-plus"></span> Añadir
            </button>
        </div>
    </div>
    <br />

    <?php


    $raids = R::getAll('select * from raid');

    $i = 0;


    foreach($raids as $r){

    echo "

            <div class = 'row'>
            
    <div class = 'col-md-4 vcenter'><a href='verraid.php?id=".$r['id']."'>"
    .$r['nombre']."
    </a></div>
    <div class = 'col-md-1 vcenter'>

    <button type = 'button' class = 'btn btn-danger btn-md' onclick=\"window.location.href='borrarraid.php?id=".$r['id']."'\">
    <span class = 'glyphicon glyphicon-trash'></span> Eliminar
    </button>

    </div>

    </div><br/>
    ";
    }
    ?>



    <hr>

</div> <!-- /container -->
<?php
}
?>
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->


<?php
include 'pie.php';
?>